1. Field of the Invention
The invention relates to a method for time synchronization in a communications network, and a node in a communications network and a corresponding communications network.
2. Description of the Related Art
In many technical fields, communications networks are used to automatically execute distributed processes on a multitude of units. For industrial automation networks in particular, it is very important that the automatic processes be precisely coordinated with one another. To this end, the individual nodes in the communications network include suitable clocks, which are synchronized to a reference clock in a reference node. The reference node is often known as the master node, while the other nodes with their internal clocks are generally called slave nodes.
Protocols known from the prior art for the synchronization of the clocks in a communications network are specified in the industrial standards Institute of Electrical and Electronic Engineers (IEEE) 1588, IEEE1588v2, International Electrotechnical Commission (IEC) 61158 and IEEE 802.1AS. Synchronization messages are exchanged in the form of time-stamped packages according to these protocols.
A synchronization message originating from a master node is transmitted sequentially between the slave nodes. The synchronization message originating from the master node contains a time stamp of the first cycle counter state according to the reference clock at the time the message is sent. The slave nodes process this information and send out new synchronization messages. In doing so, each slave node adds to the first cycle counter state in the synchronization message received the estimated time lapse between the time of transmission of the synchronization message in the previous node and its own time of transmission. The cycle counter state resulting from this process is included in the synchronization message to be sent out. Optionally, a slave node can also store the first cycle counter state from the synchronization message sent out from the master node in a first field, and add the estimated time lapses in a second, separate field. Based on the information in the synchronization messages received, each slave node can synchronize its second cycle counter states according to its internal clock with the first cycle counter states according to the reference clock. The concept of the cycle counter state is to be interpreted broadly here and in the following, and in particular also with regard to the invention. For example, a cycle counter state can also be understood as a time (e.g., in nanoseconds).
One problem in synchronizing the clocks as described above is that, due to measurement errors in determining the time, varying frequencies of the individual clocks, random environmental effects, and unknown variations concerning the time delay between the receipt and transmission of synchronization messages, the internal clocks of the slave nodes cannot be sufficiently precisely attuned to the reference clock of the master node.
In order to address the aforementioned uncertainties in the synchronization of the clocks, it is known from the publication C. Na, R. L. Scheiterer, D. Obradovic, “A Kalman Filter Approach To Clock Synchronization Of Cascaded Network Elements”, 1st IFAC Workshop on Estimation and Control of Networked Systems (NecSys '09), 24-26 Sep. 2009, Venice, Italy (Na1 et al.) and from a European patent application No. 09 012 028.8 on which the publication is based, to estimate the first cycle counter states in each slave node and to synchronize the internal clocks with the reference clock by the estimated first cycle counter states, based on a probabilistic model for state variables of the nodes. The progress of the second cycle counter states of the respective second nodes is not constant, depending on first cycle counter states, and jumps may occur when a new synchronization message is received that results in the updating of the synchronization.
In the publication C. Na, P. Wolf rum, D. Obradovic, and R. L. Scheiterer, “Optimal estimation and control of clock synchronization following the precision time protocol”, Proc. of MSC 2010, Yokohama, Japan, 2010 (Na2 et al.) as well as a German patent application No. 10 2010 022 525.8 upon which the publication is based, a synchronization method is described in which first cycle counter states in a slave node are estimated by a Kalman filter, and a regulated first cycle counter state representing the synchronized time is determined from these first estimated cycle counter states with the aid of a regulation based on a linear quadratic regulator. In this method, a compensation factor is used that represents the current clock ratio of the reference clock frequency of the reference clock of the master node to the clock frequency of the internal clock of a slave node. This compensation factor is estimated based on an inherently known method; this estimate is, however, flawed, because it does not model any variations of the clock frequency.